<!DOCTYPE html>
<html>
<head>
<link rel="Stylesheet" type="text/css" href="style.css">
<title>glob pattern</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

<div id="glob pattern syntaxes"><h1 id="glob pattern syntaxes" class="header"><a href="#glob pattern syntaxes">glob pattern syntaxes</a></h1></div>
<p>
This note describes the standard UNIX glob pattern syntaxes.
</p>

<p>
<code>*</code>: a place holder, matches zero or more characters.
</p>

<p>
<code>?</code>: a place holder, matches single character.
</p>

<p>
<code>**</code>: matches zero or more characters(as same as <code>**</code>), but recursively search directories.
</p>

<p>
<code>[abc]</code>: matches one of the characters in <code>[]</code>.
</p>

<p>
<code>{pattern1, pattern2, ... , patternN}</code>: matches one of the patterns in <code>{}</code>.
</p>

<p>
Remember, <code>[]</code> matches characters, <code>{}</code> matches patterns. 
</p>
<div id="Examples"><h1 id="Examples" class="header"><a href="#Examples">Examples</a></h1></div>
<pre sh>
    ls -l ./**/file         # list all files of directories named "file" in current directories.
    rg main {*.txt, *.cpp}  # search plain string "main" in any files suffixed by "txt" or "cpp".
</pre>

</body>
</html>
